/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package interact;

import java.sql.CallableStatement;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author UnderGround
 */
public class ActionAdministrator {

    public ActionAdministrator() {
        connect.configServer();
    }

    public static boolean updateAdministrator(int id, String username, String fullname, String phone, String email, String birthday, int gender) {
        try {
            CallableStatement call = connect.connection().prepareCall("{call updateAdmin(?,?,?,?,?,?,?)}");
            call.setInt(1, id);
            call.setString(2, username);
            call.setString(3, fullname);
            call.setString(4, phone);
            call.setString(5, email);
            call.setString(6, birthday);
            call.setInt(7, gender);

            call.execute();
        } catch (SQLException ex) {
            Logger.getLogger(ActionAdministrator.class.getName()).log(Level.SEVERE, null, ex);
            return false;
        }
        return true;
    }

}
